package com.baseweb.webadmin.service.impl;


import com.baseweb.webadmin.core.model.bvo.UserRoleBvo;
import com.baseweb.webadmin.core.model.dao.ContentDao;
import com.baseweb.webadmin.core.model.dao.UserDao;
import com.baseweb.webadmin.core.model.mapper.UserMapper;
import com.baseweb.webadmin.core.model.mapper.UserRoleMapper;
import com.baseweb.webadmin.core.model.pojo.*;
import com.baseweb.webadmin.service.ContentService;
import com.baseweb.webadmin.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ContentServiceImpl implements ContentService {
    @Autowired
    private UserDao userDao;
    @Autowired
    private ContentDao contentDao;

    @Override
    public Integer insertFeedback(ByUserFeedback byUserFeedback) {
        return contentDao.insertFeedback(byUserFeedback);
    }

    @Override
    public ByUserFeedback findFeedback(Integer id) {
        return contentDao.findFeedback(id);
    }

    @Override
    public List<ByUserFeedback> selectFeedbackListByPage(Integer userId, Integer start, Integer offset) {
        return contentDao.selectFeedbackListByPage(userId, start, offset);
    }

    @Override
    public Integer selectFeedbackListCount(Integer userId) {
        return contentDao.selectFeedbackListCount(userId);
    }

    @Override
    public List<ByUserFeedback> selectFeedbackListByPage1(ByUserFeedback feedback, Integer start, Integer offset) {
        return contentDao.selectFeedbackListByPage1(feedback, start, offset);
    }

    @Override
    public Integer selectFeedbackListCount1(ByUserFeedback feedback) {
        return contentDao.selectFeedbackListCount1(feedback);
    }
//
//    @Override
//    public List<ByUserVoucher> selectVoucherListByPage(Integer userId, Integer start, Integer offset) {
//        return contentDao.selectVoucherListByPage(userId, start, offset);
//    }
//
//    @Override
//    public Integer selectVoucherListCount(Integer userId) {
//        return contentDao.selectFeedbackListCount(userId);
//    }

    @Override
    public List<ByLevel> selectLevelListByPage(Integer start, Integer offset) {
        return contentDao.selectLevelListByPage(start, offset);
    }

    @Override
    public Integer selectLevelListCount() {
        return contentDao.selectLevelListCount();
    }

    @Override
    public List<ByDict> selectDictListByPage(Integer dictType, Integer start, Integer offset) {
        return contentDao.selectDictListByPage(dictType, start, offset);
    }

    @Override
    public Integer selectDictListCount(Integer dictType) {
        return contentDao.selectDictListCount(dictType);
    }

    @Override
    public Integer insertChannel(ByChannel byChannel) {
        return contentDao.insertChannel(byChannel);
    }

    @Override
    public ByChannel findChannel(Integer id) {
        return contentDao.findChannel(id);
    }

    @Override
    public List<ByChannel> selectChannelListByPage(Integer positionId, Integer parentId, Integer status, Integer start, Integer offset) {
        return contentDao.selectChannelListByPage(positionId, parentId, status, start, offset);
    }
    @Override
    public List<ByChannel> selectChannelListByPage1(ByChannel channel, Integer start, Integer offset) {
        return contentDao.selectChannelListByPage1(channel, start, offset);
    }
    @Override
    public List<ByChannel> selectChannelListLevel2() {
        return contentDao.selectChannelListLevel2();
    }
    @Override
    public List<ByAd> findAllByAdByPrarentId(int parentId, int limit,String city) {
        return contentDao.findAllByAdByPrarentId(parentId, limit,city);
    }
    @Override
    public Integer selectChannelListCount(Integer positionId, Integer parentId, Integer status) {
        return contentDao.selectChannelListCount(positionId, parentId, status);
    }
    @Override
    public Integer selectChannelListCount1(ByChannel channel) {
        return contentDao.selectChannelListCount1(channel);
    }

    @Override
    public Integer insertNotice(ByNotice byNotice) {
        return contentDao.insertNotice(byNotice);
    }

    @Override
    public List<ByChannel> selectAllSubChannelList() {
        return contentDao.selectAllSubChannelList();
    }

    @Override
    public ByNotice findNotice(Integer id) {
        return contentDao.findNotice(id);
    }

    @Override
    public List<ByNotice> selectNoticeListByPage(Integer userId, Integer noticeType, Integer start, Integer offset) {
        return contentDao.selectNoticeListByPage(userId, noticeType, start, offset);
    }

    @Override
    public Integer selectNoticeListCount(Integer userId, Integer noticeType) {
        return contentDao.selectNoticeListCount(userId, noticeType);
    }

    @Override
    public Integer insertAd(ByAd byAd) {
        return contentDao.insertAd(byAd);
    }

    @Override
    public ByAd findAd(Integer id) {
        return contentDao.findAd(id);
    }

    @Override
    public Integer deleteAd(Integer id) {
        return contentDao.deleteAd(id);
    }
    @Override
    public Integer deleteChannel(Integer id) {
        return contentDao.deleteChannel(id);
    }
    @Override
    public Integer deleteChannelKeyWord(Integer id) {
        return contentDao.deleteChannelKeyWord(id);
    }
    @Override
    public List<ByAd> selectAdListByPage(Integer positionId, Integer status, Integer start, Integer offset) {
        return contentDao.selectAdListByPage(positionId, null, status, start, offset);
    }

    @Override
    public Integer selectAdListCount(Integer positionId, Integer status) {
        return contentDao.selectAdListCount(positionId, null, status);
    }

    @Override
    public List<ByAd> selectAdListByPage(Integer positionId, Integer parentId, Integer status, Integer start, Integer offset) {
        return contentDao.selectAdListByPage(positionId, parentId, status, start, offset);
    }

    @Override
    public Integer selectAdListCount(Integer positionId, Integer parentId, Integer status) {
        return contentDao.selectAdListCount(positionId, parentId, status);
    }
    @Override
    public List<ByAd> selectAdListByPage1(ByAd byAd,  Integer start, Integer offset) {
        return contentDao.selectAdListByPage1(byAd, start, offset);
    }
    @Override
    public List<ByAd> findAllByParentId(int parentId,int limit,String city) {
        return contentDao.findAllByParentId(parentId, limit, city);
    }
    @Override
    public List<ByAd> findAllByParentId(int parentId) {
        return contentDao.findAllByParentId(parentId);
    }
    @Override
    public List<ByChannel> findChannelByParentId(Integer parentId) {
        return contentDao.findChannelByParentId(parentId);
    }
    @Override
    public List<ByChannelKeyword> findChannelKeywordByParentId(Integer parentId) {
        return contentDao.findChannelKeywordByParentId(parentId);
    }
    @Override
    public Integer selectAdListCount1(ByAd byAd) {
        return contentDao.selectAdListCount1(byAd);
    }
    @Override
    public List<ByArticle> selectArticleListByPage(Integer userId, Integer positionId, Integer articleType, Integer start, Integer offset) {
        return contentDao.selectArticleListByPage(userId, positionId, articleType, start, offset);
    }

    @Override
    public Integer selectArticleListCount(Integer userId, Integer positionId, Integer articleType) {
        return contentDao.selectArticleListCount(userId, positionId, articleType);
    }

    @Override
    public List<ByUserComment> selectCommentListByPage(Integer userId, String tableName, String tableId, Integer start, Integer offset) {
        return contentDao.selectCommentListByPage(userId, tableName, tableId, start, offset);
    }

    @Override
    public Integer selectCommentListCount(Integer userId, String tableName, String tableId) {
        return contentDao.selectCommentListCount(userId, tableName, tableId);
    }

    @Override
    public Integer insertLevel(ByLevel byLevel) {
        return contentDao.insertLevel(byLevel);
    }

    @Override
    public ByLevel findLevel(Integer id) {
        return contentDao.findLevel(id);
    }

    @Override
    public Integer insertDict(ByDict byDict) {
        return contentDao.insertDict(byDict);
    }

    @Override
    public ByDict findDict(Integer id) {
        return contentDao.findDict(id);
    }

    @Override
    public Integer insertArticle(ByArticle byArticle) {
        return contentDao.insertArticle(byArticle);
    }

    @Override
    public ByArticle findArticle(Integer id) {
        return contentDao.findArticle(id);
    }

    @Override
    public Integer insertComment(ByUserComment byUserComment) {
        return contentDao.insertComment(byUserComment);
    }

    @Override
    public ByUserComment findComment(Integer id) {
        return contentDao.findComment(id);
    }

    @Override
    public Integer insertKeyWord(ByChannelKeyword byChannelKeyword) {
        return contentDao.insertKeyWord(byChannelKeyword);
    }

    @Override
    public ByChannelKeyword findKeyWord(Integer id) {
        return contentDao.findKeyWord(id);
    }

    @Override
    public List<ByChannelKeyword> findKeyWordList(List<Integer> ids) {
        return contentDao.findKeyWordList(ids);
    }

    @Override
    public List<ByChannelKeyword> selectKeyWordListByPage(Integer positionId, Integer parentId, String name, Integer status, Integer start, Integer offset) {
        return contentDao.selectKeyWordListByPage(positionId, parentId, name, status, start, offset);
    }
    @Override
    public List<ByChannelKeyword> selectKeyWordAllList() {
        return contentDao.selectKeyWordAllList();
    }

    @Override
    public Integer selectKeyWordListCount(Integer positionId, Integer parentId, String name, Integer status) {
        return contentDao.selectKeyWordListCount(positionId, parentId, name, status);
    }

    @Override
    public List<ByChannel> findAllByChannelByLeftList(){
        return contentDao.findAllByChannelByLeftList();
    }
    @Override
    public List<ByChannel> findAllByChannelKeyWorkByLeftList(){
        return contentDao.findAllByChannelKeyWorkByLeftList();
    }

    //根据positionId查询全部ByChannel
    @Override
    public List<ByChannel> findAllByChannelByPositionId(int positionId){
        return contentDao.findAllByChannelByPositionId(positionId);
    }

    //查询全部ByChannelKeyword
    @Override
    public List<ByChannelKeyword> findAllByChannelKeywordByLeftList(){
        return contentDao.findAllByChannelKeywordByLeftList();
    }

    //根据positionId查询全部ByAd
    @Override
    public List<ByAd> findAllByAdByPositionId(int positionId,int limit,String city){
        return contentDao.findAllByAdByPositionId(positionId,limit,city);
    }
}
